package com.javabean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.util.List;


@Controller
public class Role {
    @Value("1")
    private int id;
    @Value("干饭部")
    private String name;
    @Value("只管干饭")
    private String desc;
    @Resource
    private List<Permission> plist;

    public Role() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public List<Permission> getPlist() {
        return plist;
    }

    public void setPlist(List<Permission> plist) {
        this.plist = plist;
    }

    @Override
    public String toString() {
        return "Role{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                ", plist=" + plist +
                '}';
    }
    @PostConstruct
    public void a(){
        System.out.println("初始化方法启动！");
    }
    @PreDestroy
    public void b(){
        System.out.println("销毁方法启动！");
    }
}
